Zum Hauptinhalt springen
POST
/
toptimize
/
v1
/
rank
[Beta] Rank objects
curl --request POST \
  --url https://api.topsort.com/toptimize/v1/rank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ranking": [
    {
      "type": "listings",
      "slots": 3,
      "pageSize": 3,
      "page": {
        "type": "category",
        "value": "sneakers",
        "pageId": "/category/sneakers"
      },
      "opaqueUserId": "u_9ske45"
    }
  ]
}
'
{
  "results": [
    {
      "resultType": "listings",
      "results": [],
      "error": false
    }
  ]
}

Autorisierungen

Authorization
string
header
erforderlich

A valid API key generated in Topsort's UI.

Body

application/json

The context information to get the ranking, to rank organic and sponsored products.

ranking
object[]
erforderlich
Required array length: 1 - 5 elements
Beispiel:
[
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"page": {
"type": "category",
"value": "sneakers",
"pageId": "/category/sneakers"
},
"opaqueUserId": "u_9ske45"
}
]

Antwort

The ranking results. The list of winners will contain at most slots entries per auction. It may contain fewer or no entries at all if there aren't enough products to fill the slots.

results
object[]
erforderlich
Required array length: 1 - 5 elements
Beispiel:
[
{
"resultType": "listings",
"results": [],
"error": false
}
]